<?php
require_once('config.php');

if(isset($_POST['username']) && isset($_POST['password']))
{
	$user = htmlspecialchars($_POST['username']);
	$pass = htmlspecialchars($_POST['password']);
	if($user == $USERNAME && $pass == $PASSWORD)
	{
		$_SESSION['login'] = true;
		$_SESSION['user'] = $USERNAME;
	}
}

if(!isset($_SESSION['login']) || $_SESSION['login'] != TRUE || !isset($_SESSION['user']))
{
    echo "Please login<br>\n";
    echo '<form action="'.$_SERVER['SCRIPT_NAME'].'" method="POST"><br>';
    echo 'Username: <input type="text" name="username" /><br>';
    echo 'Password: <input type="password" name="password" /><br>';
    echo '<input type="submit" name="login" />';
    die();
}
?>